﻿@model Pre.CRM.Models.CRMModel
@{
    ViewBag.Title = "He Thong Quan Ly Khach Hang";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<ul class="nav nav-tabs" role="tablist" id="myTab">
  <li class="active"><a href="#home" role="tab" data-toggle="tab">CRM</a></li>
  <li><a href="#agents" role="tab" data-toggle="tab">Đại lý</a></li>
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="home">
    <br />
      <div class="row">
        <div class="col-xs-6">Tổng thu: </div><div class="col-xs-6">@String.Format("{0:0,0}", Model.ThuNhap.TongThu)</div>
      </div>
      <div class="row border_bottom">
        <div class="col-xs-6">Tổng chi: </div><div class="col-xs-6">@String.Format("{0:0,0}", Model.ThuNhap.TongChi)</div>
      </div>
      <div class="row">
        <div class="col-xs-6"><strong>Tồn dư: </strong></div><div class="col-xs-6"><strong>@String.Format("{0:0,0}", Model.ThuNhap.TongThu - Model.ThuNhap.TongChi)</strong></div>
      </div>
      <br />
      <div class="row">
        <div class="col-xs-6">Thu mỗi năm: </div><div class="col-xs-6">@String.Format("{0:0,0}", Model.ThuNhap.ThuMoiNam)</div>
      </div>
      <div class="row border_bottom">
        <div class="col-xs-6">Chi mỗi năm: </div><div class="col-xs-6">@String.Format("{0:0,0}", Model.ThuNhap.ChiMoiNam)</div>
      </div>
      <div class="row">
        <div class="col-xs-6"><strong>Dư mỗi năm: </strong></div><div class="col-xs-6"><strong>@String.Format("{0:0,0}", Model.ThuNhap.ThuMoiNam - Model.ThuNhap.ChiMoiNam)</strong></div>
      </div>
  </div>
  <div class="tab-pane" id="agents">
      <form id='frmAgent' style=" margin-bottom:0px; margin-top:10px; padding-bottom:10px;" class="border_bottom" method="POST">
           <label class="add_domain"><center>Add Domain</center></label>
           <input id='agent' name="domain" type="text" class="input_add_domain" />
           <input name="" type="submit" class="bt_add_domain" value=""/>
           <div class="space"></div>
  
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
              @foreach (var o in Model.Agents)
              {
              <tr>
                <td class="padding_bottom_10px padding_top_10px border_bottom"><a href='/Customer?agent=@o' class="a_link">@o</a></td>
                <td width="36"  height="36" class="padding_left_10px padding_right_10px border_bottom">
                    <a href='/Agent/Detail?domain=@o' class="bt_edit"><img src="/Content/images/bt_edit.jpg" alt="detail" width="36px" height="36px"/></a>
                </td>
                <td width="36" height="36"  class="border_bottom"><input name="" type="button" value="" class="bt_connet" onclick="Submit('@o')"/></td>
              </tr>
              }
            </table>
        </form>
  </div>
</div>

<script language="javascript">
    function Submit(value) {
        $('#agent').val(value);
        $("#frmAgent").submit();
    }

    $('#myTab a').click(function (e) {
        e.preventDefault();
        $(this).tab('show');
    })
</script>

